import request from '@/utils/request'

// 查询采购需求列表
export function listNeed(query) {
  return request({
    url: '/mes/need/buyNeedList',
    method: 'get',
    params: query
  })
}

// 查询采购需求详细
export function getNeed(needId) {
  return request({
    url: '/mes/need/' + needId,
    method: 'get'
  })
}

// 新增采购需求
export function addNeed(data) {
  return request({
    url: '/mes/need',
    method: 'post',
    data: data
  })
}

// 修改采购需求
export function updateNeed(data) {
  return request({
    url: '/mes/need',
    method: 'put',
    data: data
  })
}

// 删除采购需求
export function delNeed(needId) {
  return request({
    url: '/mes/need/' + needId,
    method: 'delete'
  })
}
// 生成采购订单
export function createBuyorder(data) {
  return request({
    url: '/mes/need/createBuyorder',
    method: 'post',
    data:data
  })
}
// 采购订单详情
export function getDetais(query) {
  return request({
    url: '/mes/need/getDetais',
    method: 'get',
    params:query
  })
}
